package org.makcro.sms.services.chat.base.business;

import org.makcro.sms.services.chat.base.dao.AgentDao;
import org.makcro.sms.services.chat.model.Agent;

/**
 * Login service for chat application
 * @author makcro
 *
 */
public class LoginService {

	private AgentDao agentDAO;
	
	/**
	 * Authenticate agents using user name and password
	 * @param username agent's user name
	 * @param password agent's password
	 * @return {@link Agent} instance if authentication is successful, null otherwise
	 */
	public Agent authenticateAgent(String username, String password){
		
		return agentDAO.login(username, password);
	}
	
	public void setAgentDAO(AgentDao agentDAO) {
		this.agentDAO = agentDAO;
	}
}
